package com.tvunetworks.device.extra.service.feign;

import com.tvunetworks.center.common.feign.media.MediaFeignInterface;
import com.tvunetworks.center.common.model.dto.GridDto;
import com.tvunetworks.center.common.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * media
 * @author andy
 */
@FeignClient("${media.service.name:tvucc-media}")
public interface MediaFeignService extends MediaFeignInterface {
    /**
     * add
     * @param gridDto grid
     * @return r
     */
    @PostMapping({"/add/grid"})
    Result addOrUpdateGridOutput(@RequestBody GridDto gridDto);

    /**
     * get
     * @param rids rids
     * @return r
     */
    @GetMapping({"get/grid"})
    List<GridDto> getGrids(@RequestParam(value = "rids") String rids);

    /**
     * delete
     * @param rids rids
     * @param pairId pairId
     * @return r
     */
    @DeleteMapping("delete/grid")
    Result deleteGrid(@RequestParam(value = "rids") String rids,@RequestParam(value = "pairId",required = false) String pairId);

    /**
     * grid live record
     * @param gridDto g
     * @param origin o
     * @return r
     */
    @PostMapping("record/grid/live")
    Result recordGridLive(@RequestBody GridDto gridDto,@RequestParam("origin") String origin);

    /**
     * get grid by condition
     * @param gridDto gridDto
     * @return list
     */
    @PostMapping("get/grids")
    List<GridDto> getGrids(@RequestBody GridDto gridDto);
}
